<!DOCTYPE html>
<html>
<head>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <title>登录界面</title>
    <link href="__PUBLIC__/assets/css/bs3/dpl.css" rel="stylesheet">
    <link href="__PUBLIC__/assets/css/bs3/bui.css" rel="stylesheet">
</head>
<body style="background-color: #F5F5F5;">
<div class="demo-content" style="margin-top: 10%;margin-left: 10%;">
    <div class="row" >
        <div class="row">
            <form class="form-horizontal well" method="post" action="/admin/Index/login" name="form" id="J_Form">
                <div class="row span24 offset12" >
                    <label class="control-label">用户名：</label>
                    <div class="controls control-row-auto">
                        <input type="text" name="admin_name" class="input-large control-text" placeholder="用户名" data-rules="{required:true}">
                    </div>
                </div>
                <div class="row span24 offset12" >
                    <label class="control-label">密&nbsp;&nbsp;&nbsp;码：</label>
                    <div class="controls control-row-auto">
                        <input type="password" name="admin_pass" class="input-large control-text" placeholder="密码" data-rules="{required:true}">
                    </div>
                </div>
                <div class="row span24" style="margin-bottom: 1%">
                    <div class="control-label offset14">
                        <button type="button" class="button button button-primary" id="btnReg" onfocus="this.blur();">登&nbsp;&nbsp;录</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <hr>
</div>
</body>
</html>
<script src="__PUBLIC__/assets/js/jquery-1.8.1.min.js"></script>
<script src="__PUBLIC__/assets/js/bui-min.js"></script>
<script src="__PUBLIC__/assets/js/sea.js"></script>
<script src="__PUBLIC__/assets/js/config.js"></script>
<script type="text/javascript" src="__PUBLIC__/assets/js/jquery.md5.js"></script>
<script type="text/javascript">
 $('button').click(function(){
     var name;
     var password;
     name=$('[name=admin_name]').val();
     password=$.md5($('[name=admin_pass]').val());
     $.post("{:U('dologin')}",{name:name,password:password},function(result){
         //code 0000验证通过 1001用户名不正确 1002密码不正确
         eval("value="+result);
         if(value.code=='0000'){
             location.href="{:U('Index')}";
         }else{
             var msg='<h4>'+value.message+'</h4>'+'<p class="auxiliary-text">请确保您输入的帐号或密码正确</p>';
             $('[name=admin_pass]').val('');
              BUI.Message.Alert(msg,'error');
         }
     })
 })
</script>